//
//  UIButton+Extension.h
//  SaleHouse
//
//  Created by 陈胜华 on 16/11/3.
//  Copyright © 2016年 苏军朋. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^ButtonBlock)(UIButton* btn);

typedef NS_ENUM(NSInteger,DFButtonImageDirection){
    DFButtonImageDirectionLeft,   //图左字右
    DFButtonImageDirectionRight,  //图右字做
    DFButtonImageDirectionCenter, //图文居中
    DFButtonImageDirectionTop,    //图上文下
    DFButtonImageDirectionBottom, //图下文上
};

@interface UIButton (Extension)

/**
 *  扩展Buttom的点击范围
 *
 *  @param top    top    方向延伸
 *  @param right  right  方向延伸
 *  @param bottom bottom 方向延伸
 *  @param left   left   方向延伸
 */
- (void)setEnlargeEdgeWithTop:(CGFloat)top
                         right:(CGFloat)right
                        bottom:(CGFloat)bottom
                          left:(CGFloat)left;

///图文混合，调整排布
- (void)setupEdgeInsetsByDirection:(DFButtonImageDirection)direction;

- (void)addAction:(ButtonBlock)block;

- (void)addAction:(ButtonBlock)block forControlEvents:(UIControlEvents)controlEvents;

@end
